<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>计费模型</title>
	<link rel="stylesheet" href="/admin/src/css/layui.css">
	<style>
		.mr10{
			display: inline-block;
		}
		.layui-form-label{
			min-width: 140px;
		}
		.layui-upload{
			margin-left: 50px;
		}
		.layui-input-block textarea{
			width:450px;
		}
		.layui-form-item .layui-input-inline{
			width:380px;
		}
		.layui-upload-list{
			margin-left: 40px;
		}
		.info_data{padding: 9px 15px;}
		.layui-form{margin:20px auto;padding-left: 90px;}
	</style>

</head>

<body >
	<form class="layui-form " style="">
		<div class="layui-form-item">
			<label class="layui-form-label">计费模型标题：</label>
			<div class="layui-input-inline">
				<div class="info_data">{$info['title']}</div>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">计费模型编号：</label>
			<div class="layui-input-inline">
				<div class="info_data">{$info['billing_mode']}</div>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">是否启用：</label>
			<div class="layui-input-inline">
				<div class="info_data">{$info['is_status'] == 1 ? '是' : '否'}</div>
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">备注：</label>
			<div class="layui-input-inline">
				<div class="info_data">{$info['remark']}</div>
			</div>
		</div>

		<!--设置每个时间段的收费模式-->
		{volist name="info['cost_value']" id='item'}
		<div class="layui-form-item">
			<label class="layui-form-label">{$item['title']}费率：</label>
			<div class="layui-input-inline">
				<div class="layui-input-inline">
					<div class="info_data">{$item['value_name']}</div>
				</div>
			</div>
		</div>
		{/volist}
	</form>
	<script src="/admin/src/layui.js" ></script>


<script>
    layui.use(['form','jquery','upload'], function(){
      var form = layui.form ,
		  layer = layui.layer,
          upload = layui.upload,
		  $= layui.jquery;

      //监听表单提交
      form.on('submit(formDemo)', function(data){
		var getData = data.field;
		//return false;
		$.ajax({
			url: '/admin/billingModel/update/data',
			type: 'POST',
			data:getData,
			success : function (backData) {
				//添加成功
			  if(backData['status'] == 200){
				  layer.msg(backData.message,{time:1200},function(){
					  window.parent.frames.location.href="/admin/billingModel/index"
				  })
				  
			  }else{
				  layer.msg(backData.message);
			  }
			}
		})
        return false;
      });
    });



</script>
</body>
</html>
